import java.util.Scanner;

public class test4 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        System.out.println(countAndSay(n));
    }

    public static String countAndSay(int n) {
        String result = "1";//这是默认第一行
        for (int i = 1; i <n ; i++) {
            StringBuilder stringBuilder = new StringBuilder();
            int s = result.length();
            for (int left = 0,right=0; right<s;) {
                while (right<s&&result.charAt(left)==result.charAt(right))
                    right++;
                stringBuilder.append(Integer.toString(right-left));
                stringBuilder.append(result.charAt(left));
                left = right;
            }
            result = stringBuilder.toString();
        }
        return result;
    }
}
